import request from '@/utils/request'

/**
 * 通过/拒绝
 * @param data
 */
export function saveVillageByStatus(applyId, status) {
  return request({
    url: '/user/villageCommanderApply/saveVillageByStatus',
    method: 'post',
    params: {
      applyId: applyId,
      status: status
    }
  })
}

/**
 * 批量 通过/拒绝
 * @param data
 */
export function updateBatchByStatus(applyIds, status) {
  return request({
    url: '/user/villageCommanderApply/updateBatchByStatus',
    method: 'post',
    params: {
      applyIds: applyIds,
      status: status
    }
  })
}

// 分页
export function pagingApply(query) {
  return request({
    url: '/user/villageCommanderApply/paging',
    method: 'get',
    params: query
  })
}

// 统计
export function countApply(enterpriseId, applySource) {
  return request({
    url: '/user/villageCommanderApply/countApply',
    method: 'get',
    params: {
      enterpriseId,
      applySource
    }
  })
}

/**
 * 更新自动审核提示
 */
export function updateAutoApproveHint(query) {
  return request({
    url: '/user/villageCommanderApply/updateAutoApproveHint',
    method: 'get',
    params: query
  })
}

/**
 * 获取团长申请小程序码
 * @param data
 */
export function getEnterpriseCommanderApplyCode(data) {
  return request({
    url: '/user/villageCommanderApply/getEnterpriseCommanderApplyCode',
    method: 'post',
    params: data
  })
}
